#!/usr/bin/ruby
# -*- ruby -*-
#
# http://www.reddit.com/r/dailyprogrammer/comments/12k3xr/1132012_challenge_110_easy_keyboard_shift/

s_low = [
  %w{q w e r t y u i o p [ ] { }},
  %w{a s d f g h j k l ;},
  %w{z x c v b n m ,},
]

s_low = s_low.inject({}) do |r, row|
    row.slice(1, row.size).zip(row).inject({}) do |r_i, (k, v)|
        r_i.merge(k => v)
    end.merge(r)
end

s_up = [
  %w{Q W E R T Y U I O P { }},
  %w{A S D F G H J K L :},
  %w{Z X C V B N M <},
]

s_up = s_up.inject({}) do |r, row|
    row.slice(1, row.size).zip(row).inject({}) do |r_i, (k, v)|
        r_i.merge(k => v)
    end.merge(r)
end

STDIN.each_line do |line|
    line.split(//).each do |c|
        print s_up[c] || s_low[c] || " "
    end

    puts
end
